---
title: Visualization
description: VisualizationTools enables agents to create various types of charts and plots using matplotlib.
---

## Example

The following agent can create various types of data visualizations:

```python
from agno.agent import Agent
from agno.tools.visualization import VisualizationTools

agent = Agent(
    instructions=[
        "You are a data visualization assistant that creates charts and plots",
        "Generate clear, informative visualizations based on user data",
        "Save charts to files and provide insights about the data",
        "Choose appropriate chart types for different data patterns",
    ],
    tools=[VisualizationTools(output_dir="my_charts")],
)

agent.print_response("Create a bar chart showing sales by quarter: Q1=100, Q2=150, Q3=120, Q4=180", stream=True)
```

## Toolkit Params

| Parameter                   | Type    | Default   | Description                                                    |
| --------------------------- | ------- | --------- | -------------------------------------------------------------- |
| `output_dir`                | `str`   | `"charts"`| Directory to save generated charts.                          |
| `enable_create_bar_chart`   | `bool`  | `True`    | Enable bar chart creation.                                    |
| `enable_create_line_chart`  | `bool`  | `True`    | Enable line chart creation.                                   |
| `enable_create_pie_chart`   | `bool`  | `True`    | Enable pie chart creation.                                    |
| `enable_create_scatter_plot`| `bool`  | `True`    | Enable scatter plot creation.                                 |
| `enable_create_histogram`   | `bool`  | `True`    | Enable histogram creation.                                    |

## Toolkit Functions

| Function              | Description                                                      |
| --------------------- | ---------------------------------------------------------------- |
| `create_bar_chart`    | Create bar charts for categorical data comparison.               |
| `create_line_chart`   | Create line charts for time series and trend visualization.     |
| `create_pie_chart`    | Create pie charts for proportional data representation.         |
| `create_scatter_plot` | Create scatter plots for correlation analysis.                  |
| `create_histogram`    | Create histograms for data distribution visualization.          |



## Developer Resources

- View [Tools Source](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/visualization.py)
- [Matplotlib Documentation](https://matplotlib.org/stable/contents.html)
